package com.fen.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fen.common.Result;
import com.fen.pojo.DonationProject;
import com.fen.service.DonationprojectService;
import com.fen.vo.requset.RequestDeleteByids;
import com.fen.vo.requset.RequestDonationOv;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* @Description: Donationproject控制层 
* @Author: lijiafen
* @Date:  2021/11/5
* @Time: 18:19
* @eamil: 2368044269@qq.com
*/ 
@RestController
public class DonationprojectController {

    @Autowired
    private DonationprojectService<DonationProject> donationprojectService;

    @RequestMapping("ail")
    /*查询所有受捐单位信息*/
    public Result ail()
    {
        List<DonationProject> list =donationprojectService.list();
        return Result.getSuccess().setDate(list);
    }
    @RequestMapping("/ailpage")
    public Result ailpage(RequestDonationOv requestDonationOv)
    {
        /*分页加模糊查询受捐单位信息*/
        IPage<DonationProject>page=new Page<>();
        /*模糊查询为单位名称和负责人*/
        IPage<DonationProject> list = donationprojectService.listdonation(requestDonationOv);
        return Result.getSuccess().setDate(list);
    }
}
